<?php
session_start();
include_once '../conf/conf.php';

  $pid = $_SESSION['pid'];
  
    $sql = "SELECT gn,x,y FROM gis WHERE pid = '$pid'";
    $res = mysqli_query($con, $sql) or die("Couldn't get FIRST record");
    $row = mysqli_fetch_assoc($res);

$lonx = $row['x'];
$laty = $row['y'];
mysqli_free_result($res);
mysqli_close($con);



# PHPlot Example: Point plot - scatter plot
require_once 'phplot.php';
$data = array(
    array('LRH',81.363,8.987),
    array('Home',$lonx,$laty),
    
);

$kit = new PHPlot(600, 1000);
//$kit->SetFileFormat('jpg');
$kit->SetBackgroundColor('ivory');
$kit->SetTransparentColor('ivory');
//$kit->SetBgImage('../img/sl.png','tile');
$kit->SetImageBorderType('plain');

$kit->SetPlotType('points');
$kit->SetDataType('data-data');
$kit->SetDataValues($data);
$kit->SetDataColors('red');
$kit->SetPointShapes('dot','circle');
$kit->SetPointSizes(13);
$kit->SetPlotAreaPixels(0,0,600,1000);
$kit->SetPlotAreaWorld(79.5, 5.83, 82, 9.92);
$kit->SetDrawXAxis(FALSE);
$kit->SetDrawYAxis(FALSE);
$kit->SetXDataLabelPos('none');
$kit->SetYDataLabelPos('none');
$kit->SetDrawXGrid(FALSE);
$kit->SetDrawYGrid(FALSE);
$kit->SetXTickPos('none');
$kit->SetXTickLabelPos('none');
$kit->SetYTickPos('none');
$kit->SetYTickLabelPos('none');
$kit->DrawGraph();
?>